﻿@using UEditorDemo.Models
@model NewsViewModel
@{
    ViewBag.Title = "Form";
}

<form action="/BaiduUEditor/SaveNews" method="post">
    <input hidden name="id" value="@Model.Id"/>
    <div>
        @Html.LabelFor(i=>i.Title)
        @Html.TextBoxFor(i=>i.Title,new { @class= "form-control" })
    </div>
    <div>
        <script id="container" name="content" type="text/plain">
            @Html.Raw(Model.Content)
        </script>
    </div>


    <button type="submit">提交</button>
</form>


@section scripts{

    <!-- 配置文件 -->
    <script src="~/Scripts/UEditorjs/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script src="~/Scripts/UEditorjs/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('container');
        ue.execCommand('serverparam', {
            'key': 'value'
        });
    </script>



}